<template>
	<div class="dialogBox" v-loading="loadings" element-loading-text="拼命导出中" element-loading-spinner="el-icon-loading"
		element-loading-background="rgba(0, 0, 0, 0.8)">
		<div style="width: 100%;display: flex;flex-direction: row;justify-content: flex-end;">
			<v-OutPdf @exportPdf="initPdfData"></v-OutPdf>
		</div>
		<span ref="dialogBase">
			<div class="box" ref="box">


				<div class="info-box" style="display: grid; justify-items: center; margin-top: 10px">
					<!-- 巡检服务报告汇总 -->
					<div style="width: 80%; margin-bottom: 100px" id="TEDB-xjfwbghz" ref="TEDB0">
						<header>
							<div style="background: #1c1c1c; height: 8px"></div>
							<div style="diaplay: grid; height: 30px; width: 100%">
								<p style="
                    display: grid;
                    justify-items: center;
                    font-size: 20px;
                    align-items: cneter;
                    font-weight: 600;
                  ">
									巡检服务报告汇总
								</p>
							</div>
						</header>
						<table border="1" style="border-collapse: collapse; width: 100%">
							<tr>
								<th colspan="2" style="height: 30px">巡检服务内容</th>
							</tr>
							<tr>
								<th style="width: 30%">IP</th>
								<th style="width: 70%">{{ DBInfo.ip }}</th>
							</tr>
							<tr>
								<th style="width: 30%">数据库实例名</th>
								<th style="width: 70%">
									{{
                    RESULTSDATA.DBINFO.value[0]
                      ? RESULTSDATA.DBINFO.value[0]["instance_NAME"]
                      : ""
                  }}
									<!-- {{ RESULTSDATA.DBINFO.value[0]["instance_NAME"] }} -->
								</th>
							</tr>
							<tr>
								<th style="width: 30%">数据库实例编号</th>
								<th style="width: 70%">
									{{
                    RESULTSDATA.DBINFO.value[0]
                      ? RESULTSDATA.DBINFO.value[0]["instance_NUMBER"]
                      : ""
                  }}
								</th>
							</tr>
							<tr>
								<th style="width: 30%">数据库版本</th>
								<th style="width: 70%">
									{{
                    RESULTSDATA.DBINFO.value[0]
                      ? RESULTSDATA.DBINFO.value[0]["version"]
                      : ""
                  }}
								</th>
							</tr>
							<tr>
								<th style="width: 30%">DBID</th>
								<th style="width: 70%">
									{{
                    RESULTSDATA.DBINFO.value[0]
                      ? RESULTSDATA.DBINFO.value[0]["dbid"]
                      : ""
                  }}
								</th>
							</tr>
							<tr>
								<th style="width: 30%">NAME</th>
								<th style="width: 70%">
									{{
                    RESULTSDATA.DBINFO.value[0]
                      ? RESULTSDATA.DBINFO.value[0]["name"]
                      : ""
                  }}
								</th>
							</tr>
							<tr>
								<th style="width: 30%">启动时间</th>
								<th style="width: 70%">
									{{
                    RESULTSDATA.DBINFO.value[0]
                      ? RESULTSDATA.DBINFO.value[0]["startup_TIME"]
                      : ""
                  }}
								</th>
							</tr>
							<tr>
								<th style="width: 30%">服务器名</th>
								<th style="width: 70%">
									{{
                    RESULTSDATA.DBSERVERINFO.value[0]
                      ? RESULTSDATA.DBSERVERINFO.value[0]["host_NAME"]
                      : "暂无数据"
                  }}
								</th>
							</tr>
							<tr>
								<th style="width: 30%">服务器操作系统类型</th>
								<th style="width: 70%">
									{{
                    RESULTSDATA.DBSERVERINFO.value[0]
                      ? RESULTSDATA.DBSERVERINFO.value[0]["platform_NAME"]
                      : "暂无数据"
                  }}
								</th>
							</tr>
							<tr>
								<th style="width: 30%">服务器CPU使用率</th>
								<th style="width: 70%">
									{{
                    RESULTSDATA.DBSERVERINFO.value[0]
                      ? RESULTSDATA.DBSERVERINFO.value[0]["cpuused"]
                      : "暂无数据"
                  }}
								</th>
							</tr>
							<tr>
								<th style="width: 30%">服务器内存使用率</th>
								<th style="width: 70%">
									{{
                    RESULTSDATA.DBSERVERINFO.value[0]
                      ? RESULTSDATA.DBSERVERINFO.value[0]["memoryused"]
                      : "暂无数据"
                  }}
								</th>
							</tr>
							<tr>
								<th style="width: 30%">服务器内存大小</th>
								<th style="width: 70%">
									{{
                    RESULTSDATA.DBSERVERINFO.value[0]
                      ? RESULTSDATA.DBSERVERINFO.value[0]["memory"]
                      : "暂无数据"
                  }}
								</th>
							</tr>
							<tr>
								<th style="width: 30%">服务器CPU核心数</th>
								<th style="width: 70%">
									{{
                    RESULTSDATA.DBSERVERINFO.value[0]
                      ? RESULTSDATA.DBSERVERINFO.value[0]["cpucounts"]
                      : "暂无数据"
                  }}
								</th>
							</tr>
							<tr>
								<th style="width: 30%; height: 80px">巡检结果</th>
								<th style="width: 70%">{{ InspectionResults }}</th>
							</tr>
							<tr>
								<th style="width: 30%; height: 80px">解决方案建议</th>
								<th style="width: 70%"></th>
							</tr>
						</table>
					</div>
					<!-- 巡检概述 -->
					<div style="width: 80%" id="TEDB-xjgs" ref="TEDB1">
						<header>
							<div style="background: #1c1c1c; height: 8px"></div>
							<div style="diaplay: grid; height: 30px; width: 100%">
								<p style="
                    display: grid;
                    justify-items: start;
                    font-size: 20px;
                    align-items: cneter;
                    font-weight: 600;
                  ">
									1.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;巡检概述
								</p>
							</div>
						</header>
						<div style="padding-top: 5px">
							<p style="text-indent: 2em; font-size: 20px; font-weight: 600">
								概要
							</p>
							<p style="text-indent: 2em; padding-top: 5px">
								此次巡检主要针对oracle数据库进行一次全面的健康检查，包括数据库性能等各项内容，并依照此次检查结果，提出相应的优化措施。
							</p>
						</div>
						<div style="padding-top: 5px">
							<p style="text-indent: 2em; font-size: 20px; font-weight: 600">
								目的
							</p>
							<p style="text-indent: 2em; padding-top: 30px">
								A.监控数据库的当前运行状况，确保数据库稳定运行。
							</p>
							<p style="text-indent: 2em">
								B.监控数据库的备份或容灾或集群状况，减少问题发生时的风险和责任。
							</p>
							<p style="text-indent: 2em">C.尽可能减少紧急故障发生频率。</p>
							<p style="text-indent: 2em">
								D.尽早发现系统存在的潜在问题，使可能的故障消除在萌芽状态。
							</p>
							<p style="text-indent: 2em">E.提出相应的合理改进建议。</p>
						</div>

						<div style="padding-top: 50px">
							<p style="text-indent: 2em">
								以下提请注意：本次检查仅历时半天。所以在具体的性能方面仅做相应的建议。如需在数据库性能方面进行进一步的调整，请继续选择数据库性能调整。
							</p>
						</div>
					</div>

					<!-- 巡检结果概况 -->

					<div style="width: 80%; margin-top: 100px" id="TEDB-xjjggs" ref="TEDB2">
						<header>
							<div style="background: #1c1c1c; height: 8px"></div>
							<div style="diaplay: grid; height: 30px; width: 100%">
								<p style="
                    display: grid;
                    justify-items: start;
                    font-size: 20px;
                    align-items: cneter;
                    font-weight: 600;
                  ">
									2.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;巡检结果概况
								</p>
							</div>
						</header>

						<table border="1" style="border-collapse: collapse; width: 100%">
							<tr>
								<th style="width: 40%; height: 30px">检查项</th>
								<th style="width: 20%">状态</th>
								<th style="width: 40%">详细信息</th>
							</tr>
							<tr>
								<th style="height: 40px">备份情况</th>
								<template v-if="RESULTSDATA.jcbfqk.key">
									<th style="color: red">异常</th>
								</template>
								<template v-else>
									<th>正常</th>
								</template>
								<th><a href="#TEDB-jcbfqk">查看</a></th>
							</tr>
							<tr>
								<th style="height: 40px">ASM磁盘组使用率</th>
								<!-- <th>{{RESULTSDATA.jcASMcpzsyqk.key?"异常":"正常"}}</th> -->
								<template v-if="RESULTSDATA.jcASMcpzsyqk.key">
									<th style="color: red">异常</th>
								</template>
								<template v-else>
									<th>正常</th>
								</template>
								<th><a href="#TEDB-jcASMcpzsyqk">查看</a></th>
							</tr>
							<tr>
								<th style="height: 40px">表空间使用率</th>
								<!-- <th>{{RESULTSDATA.jcbkjsyqk.key?"异常":"正常"}}</th> -->
								<template v-if="RESULTSDATA.jcbkjsyqk.key">
									<th style="color: red">异常</th>
								</template>
								<template v-else>
									<th>正常</th>
								</template>
								<th><a href="#TEDB-jcbkjsyqk">查看</a></th>
							</tr>
							<tr>
								<th style="height: 40px">回收站</th>
								<th>{{ "正常" }}</th>
								<th><a href="#TEDB-jchszdx">查看</a></th>
							</tr>
							<tr>
								<th style="height: 40px">无效对象</th>
								<th>{{ "正常" }}</th>
								<th><a href="#TEDB-jcsjkwxdx">查看</a></th>
							</tr>
							<tr>
								<th style="height: 40px">具备dba权限的特殊用户</th>
								<th>{{ "正常" }}</th>
								<th><a href="#TEDB-jcjbdbaqxdtsdx">查看</a></th>
							</tr>
							<tr>
								<th style="height: 40px">dbtime</th>
								<th>{{ "正常" }}</th>
								<th><a href="#TEDB-jcDBTIME">查看</a></th>
							</tr>
							<tr>
								<th style="height: 40px">等待事件</th>
								<th>{{ "正常" }}</th>
								<th><a href="#TEDB-jcddsj">查看</a></th>
							</tr>
							<tr>
								<th style="height: 40px">长时间事务锁</th>
								<!-- <th>{{RESULTSDATA.jccsjsws.key?"异常":"正常"}}</th> -->
								<template v-if="RESULTSDATA.jccsjsws.key">
									<th style="color: red">异常</th>
								</template>
								<template v-else>
									<th>正常</th>
								</template>
								<th><a href="#TEDB-jccsjsws">查看</a></th>
							</tr>
							<tr>
								<th style="height: 40px">统计信息收集情况</th>
								<th>{{ "正常" }}</th>
								<th><a href="#TEDB-jctjxxsjqk">查看</a></th>
							</tr>
							<tr>
								<th style="height: 40px">latch</th>
								<template v-if="RESULTSDATA.jcLATCH.key">
									<th style="color: red">异常</th>
								</template>
								<template v-else>
									<th>正常</th>
								</template>
								<th><a href="#TEDB-jcLATCH">查看</a></th>
							</tr>
							<tr>
								<th style="height: 40px">检查日志</th>
								<th>{{ "正常" }}</th>
								<th><a href="#TEDB-jcRZ">查看</a></th>
							</tr>
							<tr>
								<th style="height: 40px">内存建议</th>
								<th>{{ "正常" }}</th>
								<th><a href="#TEDB-NCJY">查看</a></th>
							</tr>
						</table>
					</div>

					<!-- 检查备份情况 -->

					<div style="width: 80%; margin-top: 100px" id="TEDB-jcbfqk" ref="TEDB3">
						<header>
							<div style="background: #1c1c1c; height: 8px"></div>
							<div style="diaplay: grid; height: 30px; width: 100%">
								<p style="
                    display: grid;
                    justify-items: start;
                    font-size: 20px;
                    align-items: cneter;
                    font-weight: 600;
                  ">
									3.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;检查备份情况
								</p>
							</div>
						</header>

						<table border="1" style="border-collapse: collapse; width: 100%">
							<tr>
								<th style="height: 30px">最后备份时间</th>
								<th style="">启动时间</th>
								<th style="">耗时</th>
								<th style="">输入大小</th>
								<th style="">输出大小</th>
								<th style="">状态</th>
							</tr>

							<template v-for="item in RESULTSDATA.jcbfqk.value[0]">
								<tr :key="item.command_id">
									<th style="height: 30px">{{ item.end_time }}</th>
									<th style="">{{ item.start_time }}</th>
									<th style="">{{ item.elapsed_time }}</th>
									<th style="">{{ item.input_bytes_display }}</th>
									<th style="">{{ item.output_bytes_display }}</th>
									<th style="">{{ item.status }}</th>
								</tr>
							</template>
						</table>

						<template>
							<div
								v-html="backupAdvice(RESULTSDATA.jcbfqk.value[0][0]?RESULTSDATA.jcbfqk.value[0]:[{status:'NOTDATA'}])">
							</div>
						</template>
					</div>

					<!-- 4.检查ASM磁盘组使用情况 -->

					<div style="width: 80%; margin-top: 100px" id="TEDB-jcASMcpzsyqk" ref="TEDB4">
						<header>
							<div style="background: #1c1c1c; height: 8px"></div>
							<div style="diaplay: grid; height: 30px; width: 100%">
								<p style="
                    display: grid;
                    justify-items: start;
                    font-size: 20px;
                    align-items: cneter;
                    font-weight: 600;
                  ">
									4.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;检查ASM磁盘组使用情况
								</p>
							</div>
						</header>

						<table border="1" style="border-collapse: collapse; width: 100%">
							<tr>
								<th style="height: 30px">磁盘组名称</th>
								<th style="">冗余类型</th>
								<th style="">状态</th>
								<th style="">总容量</th>
								<th style="">剩余量</th>
								<th style="">实际可用大小</th>
								<th style="">安全空间使用率</th>
							</tr>
							<template v-for="(item, index) in RESULTSDATA.jcASMcpzsyqk.value[0]">
								<tr :key="index">
									<th style="height: 30px">{{ item.name }}</th>
									<th style="">{{ item.type }}</th>
									<th style="">{{ item.state }}</th>
									<th style="">{{ item.total_gb }}</th>
									<th style="">{{ item.free_gb }}</th>
									<th style="">{{ item.usable_file_gb }}</th>
									<th style="">{{ item.per }}</th>
								</tr>
							</template>
						</table>
						<template v-if="
                RESULTSDATA.jcASMcpzsyqk.value &&
                  countAadvice(RESULTSDATA.jcASMcpzsyqk.value[0], {
                    ASM: 'per',
                    datum: 80,
                  }) == 1
              ">
							<div v-html="
                  advice(
                    '安全空间使用率低于80%。',
                    '定期检查，保持使用率正常。'
                  )
                "></div>
						</template>
						<template v-else-if="
                RESULTSDATA.jcASMcpzsyqk.value &&
                  countAadvice(RESULTSDATA.jcASMcpzsyqk.value[0], {
                    ASM: 'per',
                    datum: 80,
                  }) == 2
              ">
							<div v-html="
                  advice(
                    '安全空间使用率高于80%。',
                    '扩容相应ASM磁盘组，降低使用率。'
                  )
                "></div>
						</template>
						<template v-else-if="
                RESULTSDATA.jcASMcpzsyqk.value &&
                  countAadvice(RESULTSDATA.jcASMcpzsyqk.value[0], {
                    ASM: 'per',
                    datum: 80,
                  }) == 3
              ">
							<div v-html="
                  advice(
                    '未使用ASM磁盘组。',
                    '通过文件系统使用率或裸设备剩余情况判断数据空间是否足够。'
                  )
                "></div>
						</template>
					</div>

					<!-- 5.检查表空间使用情况 -->
					<div style="width: 80%; margin-top: 100px" id="TEDB-jcbkjsyqk" ref="TEDB5">
						<header>
							<div style="background: #1c1c1c; height: 8px"></div>
							<div style="diaplay: grid; height: 30px; width: 100%">
								<p style="
                    display: grid;
                    justify-items: start;
                    font-size: 20px;
                    align-items: cneter;
                    font-weight: 600;
                  ">
									5.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;检查表空间使用情况
								</p>
							</div>
						</header>

						<table border="1" style="border-collapse: collapse; width: 100%">
							<tr>
								<th style="height: 30px">表空间名</th>
								<th style="">总大小</th>
								<th style="">剩余大小</th>
								<th style="">使用率</th>
								<th style="">扩容到80%以下所需大小</th>
							</tr>
							<template v-for="(item, index) in RESULTSDATA.jcbkjsyqk.value[0]">
								<tr :key="index">
									<th style="height: 30px">{{ item.tsname }}</th>
									<th style="">{{ item.tsbytes }}</th>
									<th style="">{{ item.tsfree }}</th>
									<th style="">{{ item.per }}</th>
									<th style="">{{ item.addsizegb }}</th>
								</tr>
							</template>
						</table>

						<template v-if="
                RESULTSDATA.jcbkjsyqk.value[0] &&
                  countAadvice(RESULTSDATA.jcbkjsyqk.value[0], {
                    bkjsyqk: 'per',
                    datum: 80,
                  })
              ">
							<div v-html="
                  advice('表空间使用率低于80%。', '定期检查，保持使用率正常。')
                "></div>
						</template>
						<template v-else>
							<div v-html="
                  advice(
                    '表空间使用率高于80%。',
                    '扩容相应表空间，降低使用率。'
                  )
                "></div>
						</template>
					</div>

					<!-- 6.检查回收站对象 -->
					<div style="width: 80%; margin-top: 100px" id="TEDB-jchszdx" ref="TEDB6">
						<header>
							<div style="background: #1c1c1c; height: 8px"></div>
							<div style="diaplay: grid; height: 30px; width: 100%">
								<p style="
                    display: grid;
                    justify-items: start;
                    font-size: 20px;
                    align-items: cneter;
                    font-weight: 600;
                  ">
									6.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;检查回收站对象
								</p>
							</div>
						</header>

						<table border="1" style="border-collapse: collapse; width: 100%">
							<tr>
								<th style="height: 30px">回收站对象数</th>
								<th style="">回收站总大小</th>
							</tr>
							<template v-for="(item, index) in RESULTSDATA.jchszdx.value">
								<tr :key="index">
									<th style="height: 30px">{{ item.count }}</th>
									<th style="">{{ item.size_gb }}</th>
								</tr>
							</template>
						</table>

						<template v-if="
                !(RESULTSDATA.jchszdx.value) ||
                  countAadvice(RESULTSDATA.jchszdx.value, {
                    hszdx: ['count', 'size_gb'],
                    datum: [100, 10],
                  })
              ">
							<div v-html="
                  advice('回收站使用空间正常。', '定期检查，保持使用情况正常。')
                "></div>
						</template>
						<template v-else>
							<div v-html="
                  advice(
                    '回收站使用空间或对象较多。',
                    '核实并清理回收站内对象。'
                  )
                "></div>
						</template>
					</div>

					<!-- 7.检查数据库无效对象 -->
					<!-- <div style="width: 80%; margin-top: 100px" id="TEDB-jcsjkwxdx" ref="TEDB7">
						<header>
							<div style="background: #1c1c1c; height: 8px"></div>
							<div style="diaplay: grid; height: 30px; width: 100%">
								<p style="
                    display: grid;
                    justify-items: start;
                    font-size: 20px;
                    align-items: cneter;
                    font-weight: 600;
                  ">
									7.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;检查数据库无效对象
								</p>
							</div>
						</header>

						<table border="1" style="border-collapse: collapse; width: 100%">
							<tr>
								<th style="height: 30px">无效对象数</th>
								<th style="">无效对象总大小</th>
							</tr>
							<template v-for="(item, index) in RESULTSDATA.jcsjkwxdx.value">
								<tr :key="index">
									<th style="height: 30px">{{ item.count }}</th>
									<th style="">{{ item.object_TYPE }}</th>
								</tr>
							</template>
						</table>

						<template v-if="RESULTSDATA.jcsjkwxdx.value">
							<div v-html="advice('存在无效对象。', '确认并处理所有无效对象')"></div>
						</template>
						<template v-else>
							<div v-html="
                  advice('不存在无效对象。', '定期检查，保持数据库对象有效。')
                "></div>
						</template>
					</div> -->

					<!-- 8.检查具备dba权限的特殊用户 -->
					<div style="width: 80%; margin-top: 100px" id="TEDB-jcjbdbaqxdtsdx" ref="TEDB8">
						<header>
							<div style="background: #1c1c1c; height: 8px"></div>
							<div style="diaplay: grid; height: 30px; width: 100%">
								<p style="
                    display: grid;
                    justify-items: start;
                    font-size: 20px;
                    align-items: cneter;
                    font-weight: 600;
                  ">
									7.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;检查具备dba权限的特殊用户
								</p>
							</div>
						</header>

						<table border="1" style="border-collapse: collapse; width: 100%">
							<tr>
								<th style="height: 30px">用户名</th>
								<th style="">是否授予ADMIN OPTION</th>
								<th style="">是否指定为DEFAULT ROLE</th>
							</tr>
							<template v-for="(item, index) in RESULTSDATA.jcjbdbaqxdtsyh.value">
								<tr :key="index">
									<th style="height: 30px">{{ item.grantee }}</th>
									<th style="">{{ item.admin_option }}</th>
									<th style="">{{ item.default_role }}</th>
								</tr>
							</template>
						</table>

						<template v-if="RESULTSDATA.jcjbdbaqxdtsyh.value">
							<div v-html="
                  advice(
                    '存在系统默认用户外具有dba权限的用户。',
                    '确认并处理所有具备dba权限的用户。'
                  )
                "></div>
						</template>
						<template v-else>
							<div v-html="
                  advice(
                    '不存在系统默认用户外具有dba权限的用户。',
                    '定期检查，保持dba权限安全性。'
                  )
                "></div>
						</template>
					</div>

					<!-- 9.检查dbtime -->
					<div style="width: 80%; margin-top: 100px" id="TEDB-jcDBTIME" ref="TEDB9">
						<header>
							<div style="background: #1c1c1c; height: 8px"></div>
							<div style="diaplay: grid; height: 30px; width: 100%">
								<p style="
                    display: grid;
                    justify-items: start;
                    font-size: 20px;
                    align-items: cneter;
                    font-weight: 600;
                  ">
									8.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;检查dbtime
								</p>
							</div>
						</header>

						<table border="1" style="border-collapse: collapse; width: 100%">
							<caption style="font-size:18px;font-weight:600">
								dbtime
							</caption>
							<tr>
								<th style="height: 30px">begin_snap</th>
								<th style="">end_snap</th>
								<th style="">名称</th>
								<th style="">消耗时间（分钟）</th>
							</tr>
							<template v-for="(item, index) in RESULTSDATA.jcDBTIME.value">
								<tr :key="index">
									<th style="height: 30px">{{ item.begin_snap }}</th>
									<th style="">{{ item.end_snap }}</th>
									<th style="height: 30px">{{ item.stat_name }}</th>
									<th style="">{{ item.times }}</th>
								</tr>
							</template>
						</table>

						<template v-if="
                RESULTSDATA.jcDBTIME.value &&
                  countAadvice(RESULTSDATA.jcDBTIME.value, {
                    DBTIME: 'times',
                    datum: 60,
                  })
              ">
							<div v-html="
                  advice(
                    '数据库负载不高。',
                    '定期检查，结合等待事件及操作系统负载检查。'
                  )
                "></div>
						</template>
						<template v-else>
							<div v-html="
                  advice(
                    '数据库负载较高。',
                    '排查数据库性能消耗高的原因，结合等待事件及操作系统负载检查。'
                  )
                "></div>
						</template>
					</div>

					<!-- 10.检查等待事件 -->
					<div style="width: 80%; margin-top: 100px" id="TEDB-jcddsj" ref="TEDB10">
						<header>
							<div style="background: #1c1c1c; height: 8px"></div>
							<div style="diaplay: grid; height: 30px; width: 100%">
								<p style="
                    display: grid;
                    justify-items: start;
                    font-size: 20px;
                    align-items: cneter;
                    font-weight: 600;
                  ">
									9.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;检查等待事件
								</p>
							</div>
						</header>

						<table border="1" style="border-collapse: collapse; width: 100%">
							<tr>
								<th style="height: 30px">sid</th>
								<th style="">inst_id</th>
								<th style="">event</th>
								<th style="">Wait_Class</th>
								<th style="">count(*)</th>
							</tr>

							<template v-for="(item, index) in RESULTSDATA.jcddsj.value">
								<tr :key="index">
									<th style="height: 30px">{{ DBInfo.DBname }}</th>
									<th style="">{{ item.inst_id }}</th>
									<th style="">{{ item.event }}</th>
									<th style="">{{ item.wait_Class }}</th>
									<th style="">{{ item.cnt }}</th>
								</tr>
							</template>
						</table>

						<template v-if="
                !(RESULTSDATA.jcddsj.value) ||
                  countAadvice(RESULTSDATA.jcddsj.value, { Idle: 'wait_Class' })
              ">
							<div v-html="
                  advice('无异常等待事件。', '定期检查，保持数据库稳定。')
                "></div>
						</template>
						<template v-else>
							<div v-html="
                  advice(
                    '存在异常等待事件。',
                    '排查异常等待事件的会话，处理异常情况。'
                  )
                "></div>
						</template>
					</div>
					<!-- 11.检查长时间事务锁 -->
					<div style="width: 80%; margin-top: 100px" id="TEDB-jccsjsws" ref="TEDB11">
						<header>
							<div style="background: #1c1c1c; height: 8px"></div>
							<div style="diaplay: grid; height: 30px; width: 100%">
								<p style="
                    display: grid;
                    justify-items: start;
                    font-size: 20px;
                    align-items: cneter;
                    font-weight: 600;
                  ">
									10.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;检查长时间事务锁
								</p>
							</div>
						</header>

						<table border="1" style="border-collapse: collapse; width: 100%">
							<tr>
								<th style="height: 30px">sid</th>
								<th style="">sql_id</th>
								<th style="">prev_sql_id</th>
								<th style="">USERNAME</th>
								<th style="">MACHINE</th>
								<th style="">PROGRAM</th>
								<th style="">start_time</th>
								<th style="">el_second</th>
								<th style="">TYPE</th>
							</tr>

							<template v-for="(item, index) in RESULTSDATA.jccsjsws.value[0]">
								<tr :key="index">
									<th style="height: 30px"></th>
									<th style="">{{ item["sid"] }}</th>
									<th style="">{{ item["prev_sql_id"] }}</th>
									<th style="">{{ item["USERNAME"] }}</th>
									<th style="">{{ item["MACHINE"] }}</th>
									<th style="">{{ item["PROGRAM"] }}</th>
									<th style="">{{ item["start_time"] }}</th>
									<th style="">{{ item["el_second"] }}</th>
									<th style="">{{ item["TYPE"] }}</th>
								</tr>
							</template>
						</table>
						<template v-if="RESULTSDATA.jccsjsws.value[0]&&RESULTSDATA.jccsjsws.value[0].length>0">
							<div v-html="
                  advice('存在长时间事务锁。', '确认并处理所有长时间事务锁。')
                "></div>
						</template>
						<template v-else>
							<div v-html="
                  advice('不存在长时间事务锁。', '定期检查，保持事务稳定运行。')
                "></div>
						</template>
					</div>

					<!-- 12.检查统计信息收集情况 -->
					<div style="width: 80%; margin-top: 100px" id="TEDB-jctjxxsjqk" ref="TEDB12">
						<header>
							<div style="background: #1c1c1c; height: 8px"></div>
							<div style="diaplay: grid; height: 30px; width: 100%">
								<p style="
                    display: grid;
                    justify-items: start;
                    font-size: 20px;
                    align-items: cneter;
                    font-weight: 600;
                  ">
									11.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;检查统计信息收集情况
								</p>
							</div>
						</header>

						<table border="1" style="border-collapse: collapse; width: 100%">
							<tr>
								<th style="height: 30px">用户名</th>
								<th style="">统计信息收集时间</th>
								<th style="">表数量</th>
							</tr>
							<template v-for="(item, index) in RESULTSDATA.jctjxxsjqk.value">
								<tr :key="index">
									<th style="height: 30px">{{ item.owner }}</th>
									<th style="">{{ item.last_ANALYZED }}</th>
									<th style="">{{ item.count }}</th>
								</tr>
							</template>
						</table>

						<template v-if="
                RESULTSDATA.jctjxxsjqk.value &&
                  countAadvice(RESULTSDATA.jctjxxsjqk.value, {
                    Date: true,
                    name: 'last_ANALYZED',
                  })
              ">
							<div v-html="
                  advice(
                    '已进行统计信息收集。',
                    '定期检查，保持及时进行统计信息收集。'
                  )
                "></div>
						</template>
						<template v-else>
							<div v-html="
                  advice(
                    '未及时进行统计信息收集。',
                    '对常用表进行统计信息收集。'
                  )
                "></div>
						</template>
					</div>

					<!-- 13.检查latch -->
					<div style="width: 80%; margin-top: 100px" id="TEDB-jcLATCH" ref="TEDB13">
						<header>
							<div style="background: #1c1c1c; height: 8px"></div>
							<div style="diaplay: grid; height: 30px; width: 100%">
								<p style="
                    display: grid;
                    justify-items: start;
                    font-size: 20px;
                    align-items: cneter;
                    font-weight: 600;
                  ">
									12.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;检查latch命中率
								</p>
							</div>
						</header>

						<table border="1" style="border-collapse: collapse; width: 100%">
							<tr v-for="(value, key) in RESULTSDATA.jcLATCH.value
                  ? RESULTSDATA.jcLATCH.value[0][0]
                  : []" :key="key">
								<th style="height: 30px">{{ key }}</th>
								<th style="">{{ value }}</th>
							</tr>
						</table>

						<template v-if="
                RESULTSDATA.jcLATCH.value &&
                  countAadvice(RESULTSDATA.jcLATCH.value[0][0], {
                    radix: 99,
                    percentage: true,
                  })
              ">
							<div v-html="
                  advice(
                    '所有命中率大于等于99%，命中率情况正常。',
                    '定期检查，保持各命中率正常。'
                  )
                "></div>
						</template>
						<template v-else>
							<div v-html="
                  advice(
                    '存在命中率小于99%，存在命中率异常情况。',
                    '排查命中率降低原因并处理。'
                  )
                "></div>
						</template>
					</div>

					<!-- 检查日志 -->
					<div style="width: 80%; margin-top: 100px" id="TEDB-jcRZ" ref="TEDB14">
						<header>
							<div style="background: #1c1c1c; height: 8px"></div>
							<div style="diaplay: grid; height: 30px; width: 100%">
								<p style="
                    display: grid;
                    justify-items: start;
                    font-size: 20px;
                    align-items: cneter;
                    font-weight: 600;
                  ">
									13.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;检查日志
								</p>
							</div>
						</header>
						<div style="width: 100%; border-style: outset; border-color: #d0d0d0"
							v-for="(item, index) in RESULTSDATA.jcLOG.value" :key="index">
							<p>{{ index }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ item }}</p>
						</div>
						<template v-if="RESULTSDATA.jcLOG.value == ''">
							<div v-html="
                  advice(
                    '无严重告警。',
                    '定期检查，保持数据库稳定运行。'
                  )
                "></div>
						</template>
						<template v-else>
							<div v-html="
                  advice(
                    '存在数据库报错信息。',
                    '确认并处理所有告警问题。'
                  )
                "></div>
						</template>
					</div>

					<!-- 内存建议 -->
					<div style="width: 80%; margin-top: 100px" id="TEDB-NCJY" ref="TEDB14">
						<header>
							<div style="background: #1c1c1c; height: 8px"></div>
							<div style="diaplay: grid; height: 30px; width: 100%">
								<p style="
                    display: grid;
                    justify-items: start;
                    font-size: 20px;
                    align-items: cneter;
                    font-weight: 600;
                  ">
									14.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;内存建议
								</p>
							</div>
						</header>

						<!-- MOMENY -->
						<table border="1" style="border-collapse: collapse; width: 100%">
							<caption style="font-size:18px;font-weight:600">
								MOMENY
							</caption>
							<tr>
								<th style="height: 30px">MENMORY大小（MB）</th>
								<th style="">MEMORY调整倍率</th>
								<th style="">预估调整后的dbtime倍率</th>
							</tr>
							<template v-for="(item, index) in RESULTSDATA.DBMEMORY.value.data">
								<tr :key="index">
									<th style="height: 30px">{{ item.menmory_SIZE }}</th>
									<th style="">{{ item.memory_SIZE_FACTOR }}</th>
									<th style="">{{ item.estd_DB_TIME_FACTOR }}</th>
								</tr>
							</template>
						</table>

						<div style="padding-top: 5px;margin-bottom:30px">
							<span style="font-weight: 800">检查结果：</span><span>当前值为:{{
                  RESULTSDATA.DBMEMORY.value.current || "无当前值"
                }},建议值为:{{
                  RESULTSDATA.DBMEMORY.value.target || "无建议值"
                }}</span>
						</div>

						<!-- SGA -->
						<table border="1" style="border-collapse: collapse; width: 100%">
							<caption style="font-size:18px;font-weight:600">
								SGA
							</caption>
							<tr>
								<th style="height: 30px">SGA大小（MB）</th>
								<th style="">SGA调整倍率</th>
								<th style="">预估调整后的dbtime倍率</th>
								<th style="">预估物理读</th>
							</tr>
							<template v-for="(item, index) in RESULTSDATA.DBSGA.value.data">
								<tr :key="index">
									<th style="height: 30px">{{ item.sga_size }}</th>
									<th style="">{{ item.sga_size_factor }}</th>
									<th style="">{{ item.estd_db_time_factor }}</th>
									<th style="">{{ item.estd_physical_reads }}</th>
								</tr>
							</template>
						</table>

						<div style="padding-top: 5px;margin-bottom:30px">
							<span style="font-weight: 800">检查结果：</span><span>当前值为:{{
                  RESULTSDATA.DBSGA.value.current || "无当前值"
                }},建议值为:{{
                  RESULTSDATA.DBSGA.value.target || "无建议值"
                }}</span>
						</div>

						<!-- PGA -->
						<table border="1" style="border-collapse: collapse; width: 100%">
							<caption style="font-size:18px;font-weight:600">
								PGA
							</caption>
							<tr>
								<th style="height: 30px">PGA大小（MB）</th>
								<th style="">PGA调整倍率</th>
								<th style="">预估调整后的PGA命中率</th>
								<th style="">预估PGA负载</th>
							</tr>
							<template v-for="(item, index) in RESULTSDATA.DBPGA.value.data">
								<tr :key="index">
									<th style="height: 30px">{{ item.pga_Target_Est }}</th>
									<th style="">{{ item.size_Factr }}</th>
									<th style="">{{ item.estd_PGA_Cache_Hit }}</th>
									<th style="">{{ item.estd_PGA_Overalloc_Count }}</th>
								</tr>
							</template>
						</table>

						<div style="padding-top: 5px;margin-bottom:30px">
							<span style="font-weight: 800">检查结果：</span><span>当前值为:{{
                  RESULTSDATA.DBPGA.value.current || "无当前值"
                }},建议值为:{{
                  RESULTSDATA.DBPGA.value.target || "无建议值"
                }}</span>
						</div>

						<!-- SHAREDPOOL -->
						<table border="1" style="border-collapse: collapse; width: 100%">
							<caption style="font-size:18px;font-weight:600">
								SHAREDPOOL
							</caption>
							<tr>
								<th style="height: 30px">共享池大小（MB）</th>
								<th style="">共享池调整倍率</th>
								<th style="">预估节省的解析时间（秒）</th>
								<th style="">预估解析耗时（秒）</th>
								<th style="">预估解析耗时倍率</th>
							</tr>
							<template v-for="(item, index) in RESULTSDATA.DBSHAREDPOOL.value.data">
								<tr :key="index">
									<th style="height: 30px">
										{{ item.shared_POOL_SIZE_FOR_ESTIMATE }}
									</th>
									<th style="">{{ item.shared_POOL_SIZE_FACTOR }}</th>
									<th style="">{{ item.estd_LC_TIME_SAVED }}</th>
									<th style="">{{ item.estd_LC_LOAD_TIME_FACTOR }}</th>
									<th style="">{{ item.estd_LC_LOAD_TIME }}</th>
								</tr>
							</template>
						</table>

						<div style="padding-top: 5px;margin-bottom:30px">
							<span style="font-weight: 800">检查结果：</span><span>当前值为:{{
                  RESULTSDATA.DBSHAREDPOOL.value.current || "无当前值"
                }},建议值为:{{
                  RESULTSDATA.DBSHAREDPOOL.value.target || "无建议值"
                }}</span>
						</div>

						<!-- DBCACHE -->
						<table border="1" style="border-collapse: collapse; width: 100%">
							<caption style="font-size:18px;font-weight:600">
								DBCACHE
							</caption>
							<tr>
								<th style="height: 30px">db_cache大小（MB）</th>
								<th style="">db_cache调整倍率</th>
								<th style="">预估物理读</th>
								<th style="">预估物理读占时间的百分比</th>
							</tr>
							<template v-for="(item, index) in RESULTSDATA.DBDBCACHE.value.data">
								<tr :key="index">
									<th style="height: 30px">{{ item.size_FOR_ESTIMATE }}</th>
									<th style="">{{ item.size_FACTOR }}</th>
									<th style="">{{ item.physical_READS }}</th>
									<th style="">{{ item.pct_OF_DB_TIME_FOR_READS }}</th>
								</tr>
							</template>
						</table>

						<div style="padding-top: 5px;margin-bottom:30px">
							<span style="font-weight: 800">检查结果：</span><span>当前值为:{{
                  RESULTSDATA.DBDBCACHE.value.current || "无当前值"
                }},建议值为:{{
                  RESULTSDATA.DBDBCACHE.value.target || "无建议值"
                }}</span>
						</div>
					</div>
				</div>
			</div>
		</span>
	</div>
</template>

<script>
	import moment from "moment";
	import vOutPdf from "@/components/common/outPdf/outPdf";
	import {
		indexedDb
	} from "@/utils/IndexedDB.js";

	export default {
		props: {
			info: null
		},
		components: {
			vOutPdf,
		},
		data() {
			return {
				thisTime: moment(new Date()).format("YYYY年MM月DD日"),
				loadings: false,
				InspectionResults: "",
				PropsData: [],
				RESULTSDATA: {
					jcbfqk: {
						key: "",
						value: "",
					},
					jcASMcpzsyqk: {
						key: "",
						value: "",
					},
					jcbkjsyqk: {
						key: "",
						value: "",
					},
					jchszdx: {
						key: "",
						value: "",
					},
					jcsjkwxdx: {
						key: "",
						value: "",
					},
					jcjbdbaqxdtsyh: {
						key: "",
						value: "",
					},
					jcDBTIME: {
						key: "",
						value: "",
					},
					jcddsj: {
						key: "",
						value: "",
					},
					jccsjsws: {
						key: "",
						value: "",
					},
					jctjxxsjqk: {
						key: "",
						value: "",
					},
					jcLATCH: {
						key: "",
						value: "",
					},
					jcLOG: {
						key: "",
						value: "",
					},
					DBINFO: {
						value: [],
					},
					DBSERVERINFO: {
						value: [],
					},
					DBMEMORY: {
						value: [],
					},
					DBSGA: {
						value: [],
					},
					DBPGA: {
						value: [],
					},
					DBSHAREDPOOL: {
						value: [],
					},
					DBDBCACHE: {
						value: [],
					},
				},
				DBInfo: {},
			};
		},
		created() {
			this.initData();
		},
		methods: {
			initData() {
				this.restData();

				this.PropsData = this.info.DATA;
				this.DBInfo = this.info.Basis;

				//  this.backUpMess=Object.keys(this.RESULTSDATA[0])[0]
				//备份情况
				this.RESULTSDATA.jcbfqk.key = this.PropsData[0] ?
					Object.keys(this.PropsData[0])[0] :
					"";
				this.RESULTSDATA.jcbfqk.value = this.PropsData[0] ?
					Object.values(this.PropsData[0]) :
					"";
				// 检查ASM磁盘组使用情况

				this.RESULTSDATA.jcASMcpzsyqk.key = this.PropsData[1] ?
					Object.keys(this.PropsData[1])[0] :
					"";
				this.RESULTSDATA.jcASMcpzsyqk.value = this.PropsData[1] ?
					Object.values(this.PropsData[1]) :
					"";

				// 检查表空间使用情况

				this.RESULTSDATA.jcbkjsyqk.key = this.PropsData[2] ?
					Object.keys(this.PropsData[2])[0] :
					"";
				this.RESULTSDATA.jcbkjsyqk.value = this.PropsData[2] ?
					Object.values(this.PropsData[2]) :
					"";

				// 检查回收站对象

				this.RESULTSDATA.jchszdx.value = this.PropsData[3] ?
					Object.values(this.PropsData[3]) :
					"";

				// 检查数据库无效对象

				this.RESULTSDATA.jcsjkwxdx.value = this.PropsData[4] ?
					Object.values(this.PropsData[4]) :
					"";

				// 检查具备dba权限的特殊用户

				this.RESULTSDATA.jcjbdbaqxdtsyh.value = this.PropsData[5] ?
					Object.values(this.PropsData[5]) :
					"";

				// 检查dbtime

				this.RESULTSDATA.jcDBTIME.value = this.PropsData[6] ?
					Object.values(this.PropsData[6]) :
					"";

				// 检查等待事件

				this.RESULTSDATA.jcddsj.value = this.PropsData[7] ?
					Object.values(this.PropsData[7]) :
					"";

				// 检查长时间事务锁
				this.RESULTSDATA.jccsjsws.key = this.PropsData[8] ?
					Object.keys(this.PropsData[8])[0] :
					"";
				this.RESULTSDATA.jccsjsws.value = this.PropsData[8] ?
					Object.values(this.PropsData[8]) :
					"";

				// 检查统计信息收集情况
				this.RESULTSDATA.jctjxxsjqk.value = this.PropsData[9] ?
					Object.values(this.PropsData[9]) :
					"";

				// 检查latch
				this.RESULTSDATA.jcLATCH.key = this.PropsData[10] ?
					Object.keys(this.PropsData[10])[0] :
					"";
				this.RESULTSDATA.jcLATCH.value = this.PropsData[10] ?
					Object.values(this.PropsData[10]) :
					"";
				//检查日志情况
				this.RESULTSDATA.jcLOG.value = Object.values(this.PropsData[11] || {});

				//数据库基本信息
				this.RESULTSDATA.DBINFO.value = Object.values(this.PropsData[12] || []);
				//服务器基本信息
				this.RESULTSDATA.DBSERVERINFO.value = Object.values(
					this.PropsData[13] || []
				);
				//内存建议 MEMORY
				this.RESULTSDATA.DBMEMORY.value = this.PropsData[14] || {
					data: [],
					current: "",
					target: "",
				};

				//内存建议  SGA
				this.RESULTSDATA.DBSGA.value = this.PropsData[15] || {
					data: [],
					current: "",
					target: "",
				};

				//内存建议 PGA
				this.RESULTSDATA.DBPGA.value = this.PropsData[16] || {
					data: [],
					current: "",
					target: "",
				};

				//内存建议  SHAREDPOOL
				this.RESULTSDATA.DBSHAREDPOOL.value = this.PropsData[17] || {
					data: [],
					current: "",
					target: "",
				};

				//内存建议 DBCACHE
				this.RESULTSDATA.DBDBCACHE.value = this.PropsData[18] || {
					data: [],
					current: "",
					target: "",
				};

				// this.PropsData.forEach((element) => {
				//   console.log(element);
				// });

				this.InspectionResults = "";

				//去空
				let filterData = [
					this.RESULTSDATA.jcLATCH.key,
					this.RESULTSDATA.jccsjsws.key,
					this.RESULTSDATA.jcbfqk.key,
					this.RESULTSDATA.jcASMcpzsyqk.key,
					this.RESULTSDATA.jcbkjsyqk.key,
				].filter((item) => item);

				this.getInspectionResults(filterData);
			},
			getInspectionResults(filterData) {
				this.InspectionResults = "";
				filterData.forEach((item, index) => {
					this.InspectionResults += `${index + 1}.${item}`;
				});
			},
			restData() {
				this.InspectionResults = "";
				for (const key in this.RESULTSDATA) {
					const element = this.RESULTSDATA[key];
					(element.key = ""), (element.value = "");
				}
				this.DBInfo = {};
			},
			htmlInit() {
				let data = this.$refs.dialogBase.innerHTML;
				let Ecmascript =
					`<script>let a =document.querySelectorAll('a');for(let i=0;i<a.length;i++)a[i].href=''<\/script>`;
				let elementHeight = (height) => {
					let num = Math.ceil(height / 980);
					return num * 980;
				};
				let itemheight = {
					TEDB0: elementHeight(this.$refs.TEDB0.offsetHeight),
					TEDB1: elementHeight(this.$refs.TEDB1.offsetHeight),
					TEDB2: elementHeight(this.$refs.TEDB2.offsetHeight),
					TEDB3: elementHeight(this.$refs.TEDB3.offsetHeight),
					TEDB4: elementHeight(this.$refs.TEDB4.offsetHeight),
					TEDB5: elementHeight(this.$refs.TEDB5.offsetHeight),
					TEDB6: elementHeight(this.$refs.TEDB6.offsetHeight),
					TEDB7: elementHeight(this.$refs.TEDB7.offsetHeight),
					TEDB8: elementHeight(this.$refs.TEDB8.offsetHeight),
					TEDB9: elementHeight(this.$refs.TEDB9.offsetHeight),
					TEDB0: elementHeight(this.$refs.TEDB10.offsetHeight),
					TEDB11: elementHeight(this.$refs.TEDB11.offsetHeight),
					TEDB12: elementHeight(this.$refs.TEDB12.offsetHeight),
					TEDB13: elementHeight(this.$refs.TEDB13.offsetHeight),
				};
				let style = `
    		#TEDB-xjfwbghz{height:${itemheight.TEDB0}px;margin-bottom:0}
        #TEDB-xjgs {height:${itemheight.TEDB1}px;}
        #TEDB-xjjggs {height:${itemheight.TEDB2}px;margin-top:0}
        #TEDB-jcbfqk {height:${itemheight.TEDB3}px;margin-top:0}
        #TEDB-jcASMcpzsyqk {height:${itemheight.TEDB4}px;margin-top:0}
        #TEDB-jcbkjsyqk {height:${itemheight.TEDB5}px;margin-top:0}
        #TEDB-jchszdx {height:${itemheight.TEDB6}px;margin-top:0}
        #TEDB-jcsjkwxdx {height:${itemheight.TEDB7}px;margin-top:0}
        #TEDB-jcjbdbaqxdtsdx {height:${itemheight.TEDB8}px;margin-top:0}
        #TEDB-jcDBTIME {height:${itemheight.TEDB9}px;margin-top:0}
        #TEDB-jcddsj {height:${itemheight.TEDB10}px;margin-top:0}
        #TEDB-jccsjsws {height:${itemheight.TEDB11}px;margin-top:0}
        #TEDB-jctjxxsjqk {height:${itemheight.TEDB12}px;margin-top:0}
        #TEDB-jcLATCH {height:${itemheight.TEDB13}px;margin-top:0}
    		`;
				return (data =
					`<!DOCTYPE html><html><head><meta charset="UTF-8"></head><body><style>a {text-decoration: none;color:#363636;display:block;}${style}</style>${data}</body>${Ecmascript}</html>`
				);
			},

			async initPdfData() {
				let data = {
					id: 0,
					html: this.$refs.dialogBase.innerHTML
				};

				indexedDb("HtmlBase", [data], "infoBase", "id");

				let url = this.$router.resolve({
					path: "/pdfDownload",
				});
				window.open(url.href);
			},
			advice(results, suggest) {
				return `
          <div style="padding-top: 10px">
                <span style="font-weight: 800">检查结果：</span>
                <span>${results}</span>
              </div>
              <div style="padding-top: 10px">
                <span style="font-weight: 800">
                  <i class="el-icon-info" style="color:blue"></i>
                  建议：
                </span>
                <span>${suggest}</span>
              </div>
      `;
			},
			countAadvice(data, field) {
				if (field.percentage) {
					let arr = [];
					for (let key in data) {
						arr.push(Number(data[key].split("%")[0]));
					}

					arr.sort((a, b) => a - b);
					if (Number(arr[0]) < field.radix) {
						return false;
					} else {
						return true;
					}
				} else if (field.Date) {
					let arr = [];

					for (let key in data) {
						if (!data[key][field.name]) {
							return false;
						} else {
							arr.push(moment(data[key][field.name]).format("YYYY-MM-DD"));
						}
					}
					let nArr = arr.sort((a, b) => a - b);
					if (
						moment(nArr[0])
						.add(1, "months")
						.format("YYYY-MM-DD") < moment().format("YYYY-MM-DD")
					) {
						return false;
					} else {
						return true;
					}
				} else if (field.Idle) {
					let status = data.filter((item) => item[field.Idle] != "Idle");
					if (status.length > 0) {
						return false;
					} else {
						return true;
					}
				} else if (field.DBTIME) {
					let nArr = data.map((item) => Number(item[field.DBTIME]));

					if (nArr[nArr.length - 1] > field.datum) {
						return false;
					} else {
						return true;
					}
				} else if (field.hszdx) {
					for (let key in data) {
						if (
							Number(data[key][field.hszdx[0]]) > field.datum[0] &&
							Number(data[key][field.hszdx[1]]) > field.datum[1]
						) {
							return false;
						} else {
							return true;
						}
					}
				} else if (field.bkjsyqk) {
					let arr = [];
					for (let key in data) {
						arr.push(Number(data[key][field.bkjsyqk].split("%")[0]));
					}
					arr.sort((a, b) => a - b);
					if (Number(arr[arr.length - 1]) > field.datum) {
						return false;
					} else {
						return true;
					}
				} else if (field.ASM) {
					let arr = [];
					for (let key in data) {
						arr.push(data[key][field.ASM]);
					}
					if (arr[0] == "" || arr[0] == undefined) {
						return 3;
					}
					const nArr = arr.map((item) => Number(item.split("%")[0]));
					nArr.sort((a, b) => a - b);
					if (nArr[nArr.length - 1] > field.datum) {
						return 2;
					} else {
						return 1;
					}
				}
			},
			backupAdvice(data) {

				let type = {
					["RUNNING"]: ["备份执行中", "等待正常完成。", 0],
					["RUNNING WITH WARNINGS"]: [
						"备份执行中，但是有告警",
						"检查日志，排查告警问题。",
						1
					],
					["RUNNING WITH ERRORS"]: [
						"备份执行中，但是有报错",
						"检查日志，排查报错问题。",
						2
					],
					["COMPLETED"]: ["备份正常完成", "保持备份定期运行。", 3],
					["COMPLETED WITH WARNINGS"]: [
						"备份完成，但是有告警，建议排查",
						"检查日志，排查告警问题。",
						4
					],
					["COMPLETED WITH ERRORS"]: [
						"备份完成，但是有报错，建议排查",
						"检查日志，排查报错问题，重新启动备份。",
						5
					],
					["FAILED"]: ["备份失败", "检查日志，排查报错问题，重新启动备份。", 6],
					['NOTDATA']: ['未进行备份', '配置定时备份任务', 7],
					// null: ["未进行备份", "配置定时备份任务"],

				};
				let status = data.map(item => {
					return type[item.status]
				})
				status.sort((a, b) => b[2] - a[2])

				return `
          <div style="padding-top: 10px">
                <span style="font-weight: 800">检查结果：</span>
                <span>${status[0][0]}</span>
              </div>
              <div style="padding-top: 10px">
                <span style="font-weight: 800">
                  <i class="el-icon-info" style="color:blue"></i>
                  建议：
                </span>
                <span>${status[0][1]}</span>
              </div>
      `;
			},
		},
	};
</script>
<style scoped lang="scss">
	.dialogBox {
		display: grid;
		grid-template-rows: auto;
		column-gap: 20px;
	}

	a {
		text-decoration: none;
		color: #909399;
	}

	.box-card {
		margin: 10px;
	}

	.a {
		text-indent: 2em;
		font-size: 16px;
		background: #b5b5b5;
		font-weight: 500;
		justify-items: center;
		list-style: none;
		display: inline-block;
	}

	.menu {
		display: none;
	}
</style>